﻿using NLog;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace SiChuan.FormsApp.AppCode.Helpers {

    public class NlogHelper {

        public static void Info(string message) {
            Logger loggerTrace = LogManager.GetLogger("Info");
            loggerTrace.Info(message);
        }

        public static void Warn(string message) {
            Logger loggerTrace = LogManager.GetLogger("Warn");
            loggerTrace.Warn(message);
        }

        public static void Warn(Exception ex) {
            Logger loggerTrace = LogManager.GetLogger("Warn");
            loggerTrace.Warn(ex);
        }

        public static void Error(Exception ex) {
            Logger loggerTraceErr = LogManager.GetLogger("Error");
            loggerTraceErr.Error(ex, ex.Message);
        }

        public static void Error(string msg, Exception ex) {
            Logger loggerTraceErr = LogManager.GetLogger("Error");
            loggerTraceErr.Error(ex, msg);
        }

        public static void Error(string message) {
            Logger loggerTraceErr = LogManager.GetLogger("Error");
            loggerTraceErr.Error(message);
        }
    }
}
